# Created by Gao Song on 2019-04-17

import importlib


def _translate_name(name):
    return ''.join(map(lambda x: x.capitalize(), name.split('_')))


def create_object(obj_class: str, obj_type: str, *args, **kwargs):
    module = importlib.import_module(f'{obj_class}.{obj_type}_{obj_class}')
    klass = getattr(module, f'{_translate_name(obj_type)}{obj_class.capitalize()}')
    return klass(*args, **kwargs)
